<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>模块添加与修改</title>
<meta name="content-type" content="text/html; charset=UTF-8">
<div th:replace="/pub.html"></div>
<script type="text/javascript">
var menuadd_submitForm = function(dialog, menu_treeGrid, west_tree,p) {
	if ($('#menu_addForm').form('validate')) {
		$.post('/perm/menu/add', $("#menu_addForm").serialize(), function(j) {
			if (j.success) {
				menu_treeGrid.treegrid('reload');
				west_tree.tree('reload');
				dialog.dialog('destroy');
			}
			p.messager.show({
				title : '提示',
				msg : j.msg,
				timeout : 5000,
				showType : 'slide'
			});
		}, 'json').error(function() {
			$.messager.show({
				title : '提示',
				msg : '你的权限不够',
				timeout : 5000,
				showType : 'slide'
			});
		});
	}
};
</script>
</head>

<body>
	<form id="menu_addForm" method="post">
		<input type="hidden" id="menu_pid" name="pid" th:field="${menu.pid}"/>
		<input type="hidden" id="menu_id" name="id" th:field="${menu.id}"/>
		<table class="table table-hover table-condensed">
			<tr>
				<th>菜单名</th>
				<td><input type="text" name="text" th:field="${menu.text}" class="easyui-validatebox" data-options="required:true,missingMessage:'菜单名必填'" /></td>
			</tr>
			<tr>
				<th>编码</th>
				<td><input type="text" name="code" th:field="${menu.code}" /></td>
			</tr>
			<tr>
				<th>URL</th>
				<td><input type="text" name="url" th:field="${menu.url}" size="30" /></td>
			</tr>
			<tr>
				<th>级别</th>
				<td><div class="easyui-radio" id="radio_step"><!-- checked -->
							<input type="radio" name="step" value="1" th:field="*{menu.step}" label="菜单">
							<input type="radio" name="step" value="2" th:field="*{menu.step}" label="功能">
						</div></td>
			</tr>
		</table>
	</form>
</body>
</html>